package com.itheima.mapper;

import com.github.pagehelper.Page;
import com.itheima.pojo.Setmeal;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface SetmealMapper {
    /**
     * 添加套餐基础信息
     * @param setmeal
     */
    void add(Setmeal setmeal);

     //添加套餐和检查组关联关系
    void setSetmealAndCheckGroup(List list);
    //删除套餐和检查组关联关系
    @Delete("delete from t_setmeal_checkgroup where setmeal_id=#{id}")
    void deleteSetmealAndCheckGroup(Integer id);
    /**
     * 套餐分页查询
     * @param queryString
     * @return
     */
    Page<Setmeal> findPage(String queryString);

    /**
     * 根据id查询套餐
     * @param id
     * @return
     */
    @Select("select * from t_setmeal where id=#{id}")
    Setmeal findById(Integer id);



    /**
     * 编辑套餐
     * @param setmeal
     */
    void edit(Setmeal setmeal);

    /**
     * 删除套餐
     * @param id
     */
    @Delete("delete from t_setmeal where id=#{id}")
    void deleteById(Integer id);
}
